package com.example.homework4;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    private Button button2;
    private EditText edittext1;
    private EditText edittext2;
    private EditText edittext3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        edittext1=findViewById(R.id.editTextTextEmailAddress);
        edittext2=findViewById(R.id.editTextTextPassword2);
        edittext3=findViewById(R.id.editTextTextEmailAddress2);


        button2=findViewById(R.id.button2);
        button2.setOnClickListener(this::activity);
    }


    public void activity(View view) {
        button2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, MainActivity2.class);
                intent.putExtra("com.example.homework4.textView1", edittext1.getText().toString());
                intent.putExtra("com.example.homework4.textView2", edittext2.getText().toString());
                intent.putExtra("com.example.homework4.textView3", edittext3.getText().toString());
                startActivity(intent);
            }
        });
    }


}